package hibernate.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@SuppressWarnings("serial")
@Entity
@Table(name = "musteriaygitlari", catalog = "emmy")
@NamedQueries({
@NamedQuery(name = "findMusAygtKulid", 	 query = "from Musteriaygitlari where kullaniciid = :mKulid"),
@NamedQuery(name = "findMusAygtAygitid", query = "from Musteriaygitlari where aygitid = :mAygitid")
})
public class Musteriaygitlari implements java.io.Serializable {

	private long aygitSeriNo;
	private Musteri musteri;
	private Aygit aygit;
	private Set<Aygitihbar> aygitihbars = new HashSet<Aygitihbar>(0);
	private Set<Loglar> loglars = new HashSet<Loglar>(0);
	private Serinoversiyon serinoversiyon;

	public Musteriaygitlari() {
	}

	public Musteriaygitlari(long aygitSeriNo, Musteri musteri, Aygit aygit) {
		this.aygitSeriNo = aygitSeriNo;
		this.musteri = musteri;
		this.aygit = aygit;
	}

	public Musteriaygitlari(long aygitSeriNo, Musteri musteri, Aygit aygit,
			Set<Aygitihbar> aygitihbars, Set<Loglar> loglars,
			Serinoversiyon serinoversiyon) {
		this.aygitSeriNo = aygitSeriNo;
		this.musteri = musteri;
		this.aygit = aygit;
		this.aygitihbars = aygitihbars;
		this.loglars = loglars;
		this.serinoversiyon = serinoversiyon;
	}

	@Id
	@Column(name = "aygitSeriNo", unique = true, nullable = false)
	public long getAygitSeriNo() {
		return this.aygitSeriNo;
	}

	public void setAygitSeriNo(long aygitSeriNo) {
		this.aygitSeriNo = aygitSeriNo;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "kullaniciid", nullable = false)
	public Musteri getMusteri() {
		return this.musteri;
	}

	public void setMusteri(Musteri musteri) {
		this.musteri = musteri;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "aygitid", nullable = false)
	public Aygit getAygit() {
		return this.aygit;
	}

	public void setAygit(Aygit aygit) {
		this.aygit = aygit;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "musteriaygitlari")
	public Set<Aygitihbar> getAygitihbars() {
		return this.aygitihbars;
	}

	public void setAygitihbars(Set<Aygitihbar> aygitihbars) {
		this.aygitihbars = aygitihbars;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "musteriaygitlari")
	public Set<Loglar> getLoglars() {
		return this.loglars;
	}

	public void setLoglars(Set<Loglar> loglars) {
		this.loglars = loglars;
	}

	@OneToOne(fetch = FetchType.EAGER, mappedBy = "musteriaygitlari", cascade = CascadeType.ALL)
	public Serinoversiyon getSerinoversiyon() {
		return this.serinoversiyon;
	}

	public void setSerinoversiyon(Serinoversiyon serinoversiyon) {
		this.serinoversiyon = serinoversiyon;
	}
}